package com.ai.platform.core.exception;

import com.ai.platform.core.constant.IConstants;

/**
 * Created by yeyingsheng on 2018/5/12.
 */
public class BusinessException extends RuntimeException {

    private String code;

    private String msg;

    public BusinessException(String code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public BusinessException(String msg) {
        super(msg);
        this.code= IConstants.ERROR;
        this.msg = msg;
    }

    public BusinessException(Throwable cause, String code, String msg) {
        super(msg, cause);
        this.code = code;
        this.msg = msg;
    }

    public BusinessException(Throwable cause, boolean enableSuppression, boolean writableStackTrace, String code, String msg) {
        super(msg, cause, enableSuppression, writableStackTrace);
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
